.class public final Lcom/baidu/crabsdk/b/t;
.super Ljava/lang/Object;


# static fields
.field private static aZ:Ljava/lang/String;

.field private static bq:Lcom/baidu/crabsdk/c/b;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Lcom/baidu/crabsdk/c/b<",
            "Ljava/util/List;",
            ">;"
        }
    .end annotation
.end field

.field private static br:Ljava/lang/String;

.field private static heightPixels:I

.field private static widthPixels:I


# direct methods
.method static constructor <clinit>()V
    .locals 2

    new-instance v0, Lcom/baidu/crabsdk/c/b;

    sget v1, Lcom/baidu/crabsdk/a;->g:I

    invoke-direct {v0, v1}, Lcom/baidu/crabsdk/c/b;-><init>(I)V

    sput-object v0, Lcom/baidu/crabsdk/b/t;->bq:Lcom/baidu/crabsdk/c/b;

    const-string v0, ""

    sput-object v0, Lcom/baidu/crabsdk/b/t;->br:Ljava/lang/String;

    sput-object v0, Lcom/baidu/crabsdk/b/t;->aZ:Ljava/lang/String;

    const/4 v0, 0x0

    sput v0, Lcom/baidu/crabsdk/b/t;->widthPixels:I

    sput v0, Lcom/baidu/crabsdk/b/t;->heightPixels:I

    return-void
.end method

.method public static P()Ljava/lang/String;
    .locals 2

    sget-object v0, Lcom/baidu/crabsdk/b/t;->bq:Lcom/baidu/crabsdk/c/b;

    invoke-virtual {v0}, Ljava/util/LinkedList;->size()I

    move-result v0

    if-lez v0, :cond_0

    new-instance v0, Lorg/json/JSONArray;

    sget-object v1, Lcom/baidu/crabsdk/b/t;->bq:Lcom/baidu/crabsdk/c/b;

    invoke-direct {v0, v1}, Lorg/json/JSONArray;-><init>(Ljava/util/Collection;)V

    invoke-virtual {v0}, Lorg/json/JSONArray;->toString()Ljava/lang/String;

    move-result-object v0

    return-object v0

    :cond_0
    const-string v0, ""

    return-object v0
.end method

.method public static Q()Z
    .locals 1

    invoke-static {}, Lcom/baidu/crabsdk/b/t;->P()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/String;->length()I

    move-result v0

    if-lez v0, :cond_0

    const/4 v0, 0x1

    return v0

    :cond_0
    const/4 v0, 0x0

    return v0
.end method

.method private static b(Landroid/view/View;)Landroid/webkit/WebView;
    .locals 6

    instance-of v0, p0, Landroid/view/ViewGroup;

    if-eqz v0, :cond_2

    check-cast p0, Landroid/view/ViewGroup;

    const/4 v0, 0x0

    const/4 v1, 0x0

    :goto_0
    invoke-virtual {p0}, Landroid/view/ViewGroup;->getChildCount()I

    move-result v2

    if-ge v1, v2, :cond_2

    invoke-virtual {p0, v1}, Landroid/view/ViewGroup;->getChildAt(I)Landroid/view/View;

    move-result-object v2

    invoke-virtual {v2}, Landroid/view/View;->getVisibility()I

    move-result v3

    if-nez v3, :cond_1

    new-instance v3, Landroid/graphics/Rect;

    sget v4, Lcom/baidu/crabsdk/b/t;->widthPixels:I

    sget v5, Lcom/baidu/crabsdk/b/t;->heightPixels:I

    invoke-direct {v3, v0, v0, v4, v5}, Landroid/graphics/Rect;-><init>(IIII)V

    invoke-virtual {v2, v3}, Landroid/view/View;->getLocalVisibleRect(Landroid/graphics/Rect;)Z

    move-result v3

    if-eqz v3, :cond_1

    instance-of v3, v2, Landroid/webkit/WebView;

    if-eqz v3, :cond_0

    check-cast v2, Landroid/webkit/WebView;

    return-object v2

    :cond_0
    invoke-static {v2}, Lcom/baidu/crabsdk/b/t;->b(Landroid/view/View;)Landroid/webkit/WebView;

    move-result-object v2

    if-eqz v2, :cond_1

    return-object v2

    :cond_1
    add-int/lit8 v1, v1, 0x1

    goto :goto_0

    :cond_2
    const/4 p0, 0x0

    return-object p0
.end method

.method public static urlRecordEvent(Landroid/view/MotionEvent;Landroid/app/Activity;)V
    .locals 4

    if-nez p1, :cond_0

    return-void

    :cond_0
    sget v0, Lcom/baidu/crabsdk/b/t;->widthPixels:I

    if-eqz v0, :cond_1

    sget v0, Lcom/baidu/crabsdk/b/t;->heightPixels:I

    if-nez v0, :cond_2

    :cond_1
    new-instance v0, Landroid/util/DisplayMetrics;

    invoke-direct {v0}, Landroid/util/DisplayMetrics;-><init>()V

    invoke-virtual {p1}, Landroid/app/Activity;->getWindowManager()Landroid/view/WindowManager;

    move-result-object v1

    invoke-interface {v1}, Landroid/view/WindowManager;->getDefaultDisplay()Landroid/view/Display;

    move-result-object v1

    invoke-virtual {v1, v0}, Landroid/view/Display;->getMetrics(Landroid/util/DisplayMetrics;)V

    iget v1, v0, Landroid/util/DisplayMetrics;->heightPixels:I

    sput v1, Lcom/baidu/crabsdk/b/t;->heightPixels:I

    iget v0, v0, Landroid/util/DisplayMetrics;->widthPixels:I

    sput v0, Lcom/baidu/crabsdk/b/t;->widthPixels:I

    :cond_2
    invoke-virtual {p0}, Landroid/view/MotionEvent;->getAction()I

    move-result p0

    if-eqz p0, :cond_3

    goto/16 :goto_1

    :cond_3
    invoke-virtual {p1}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    move-result-object p0

    invoke-virtual {p0}, Ljava/lang/Class;->getName()Ljava/lang/String;

    move-result-object p0

    sget-object v0, Lcom/baidu/crabsdk/b/t;->aZ:Ljava/lang/String;

    invoke-virtual {p0, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-nez v0, :cond_4

    const-string v0, "***** !tempName.equals(activityName) *****"

    invoke-static {v0}, Lcom/baidu/crabsdk/c/a;->u(Ljava/lang/String;)I

    sput-object p0, Lcom/baidu/crabsdk/b/t;->aZ:Ljava/lang/String;

    sget-object p0, Lcom/baidu/crabsdk/b/t;->bq:Lcom/baidu/crabsdk/c/b;

    invoke-virtual {p0}, Ljava/util/LinkedList;->clear()V

    :cond_4
    if-eqz p1, :cond_5

    :try_start_0
    invoke-virtual {p1}, Landroid/app/Activity;->getWindow()Landroid/view/Window;

    move-result-object p0

    invoke-virtual {p0}, Landroid/view/Window;->getDecorView()Landroid/view/View;

    move-result-object p0

    if-eqz p0, :cond_5

    invoke-static {p0}, Lcom/baidu/crabsdk/b/t;->b(Landroid/view/View;)Landroid/webkit/WebView;

    move-result-object p0

    goto :goto_0

    :cond_5
    const/4 p0, 0x0

    :goto_0
    if-eqz p0, :cond_6

    invoke-virtual {p0}, Landroid/webkit/WebView;->getUrl()Ljava/lang/String;

    move-result-object p1

    sget-object v0, Lcom/baidu/crabsdk/b/t;->br:Ljava/lang/String;

    invoke-virtual {p1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-nez v0, :cond_6

    const-string v0, "-------- !tempUrl.equals(mUrl) --------"

    invoke-static {v0}, Lcom/baidu/crabsdk/c/a;->u(Ljava/lang/String;)I

    sput-object p1, Lcom/baidu/crabsdk/b/t;->br:Ljava/lang/String;

    new-instance p1, Ljava/util/ArrayList;

    invoke-direct {p1}, Ljava/util/ArrayList;-><init>()V

    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v0

    const-wide/16 v2, 0x3e8

    div-long/2addr v0, v2

    long-to-int v1, v0

    invoke-static {v1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v0

    invoke-virtual {p1, v0}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    invoke-virtual {p0}, Landroid/webkit/WebView;->getTitle()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {p1, v0}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    sget-object v0, Lcom/baidu/crabsdk/b/t;->br:Ljava/lang/String;

    invoke-virtual {p1, v0}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    new-instance v0, Ljava/lang/StringBuilder;

    const-string v1, "title:"

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {p0}, Landroid/webkit/WebView;->getTitle()Ljava/lang/String;

    move-result-object p0

    invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    const-string p0, "; url:"

    invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    sget-object p0, Lcom/baidu/crabsdk/b/t;->br:Ljava/lang/String;

    invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object p0

    invoke-static {p0}, Lcom/baidu/crabsdk/c/a;->u(Ljava/lang/String;)I

    sget-object p0, Lcom/baidu/crabsdk/b/t;->bq:Lcom/baidu/crabsdk/c/b;

    invoke-virtual {p0, p1}, Lcom/baidu/crabsdk/c/b;->add(Ljava/lang/Object;)Z

    new-instance p0, Ljava/lang/StringBuilder;

    const-string p1, "###### jsonArray.toString() : "

    invoke-direct {p0, p1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-static {}, Lcom/baidu/crabsdk/b/t;->P()Ljava/lang/String;

    move-result-object p1

    invoke-virtual {p0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {p0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object p0

    invoke-static {p0}, Lcom/baidu/crabsdk/c/a;->u(Ljava/lang/String;)I
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_1

    :catch_0
    const-string p0, "createUrlRecord error!!"

    invoke-static {p0}, Lcom/baidu/crabsdk/c/a;->v(Ljava/lang/String;)I

    :cond_6
    :goto_1
    return-void
.end method
